#pragma once
#include "Control.h"
#include <memory>
namespace cxgui
{
using namespace std;
class ContentControl : public Control
{
public:

	/// Returns the content of the control
	shared_ptr<Control> GetContent() const;

	virtual void Update() override;

	/// Sets the content of the control	
	void SetContent(shared_ptr<Control> content);	
	virtual ~ContentControl();
	
	VerticalAlignment GetVerticalContentAlignment() const;
	void SetVerticalContentAlignment(VerticalAlignment alignment);

	HorizontalAlignment GetHorizontalContentAlignment() const;
	void SetHorizontalContentAlignment(HorizontalAlignment alignment);
	virtual void Draw() override;
protected:	
	void OnContentChanged();

	/// Returns the size that accommodates the control
	virtual Vec2f GetPreferedSize() override;	

	
	virtual void OnClientRectangleChanged() override;

	virtual bool IsLayoutDirty() const;

	virtual void IsLayoutDirty( bool isDirty );



	

	shared_ptr<Control> _content;	
};

}
